package entities;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 * The persistent class for the friends database table.
 * 
 */
@Entity
@Table(name="lindenbets")

@NamedQueries({

@NamedQuery(name="getLotteryAppWinners", 
		query="SELECT x FROM LindenBet x WHERE x.lotteryGame.drawnNumber=x.betNumber AND " +
				"x.appId=?1 AND x.lotteryGame.active=1")
				
})


public class LindenBet implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="Id", unique=true, nullable=false)
	private int id;
	
	@Column(name="LindenEuros", nullable=false)
	private int lindenEuros;
	
	@Column(name="UserId", nullable=false)
	private int userId;
	
	@Column(name="AppId", nullable=false)
	private int appId;
	
	@Column(name="Number", nullable=false)
	private int betNumber;
	
	//bi-directional many-to-one association to Userprofile
    @ManyToOne
	@JoinColumn(name="LotteryId", nullable=false)
	private LotteryGame lotteryGame;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getLindenEuros() {
		return lindenEuros;
	}

	public void setLindenEuros(int lindenEuros) {
		this.lindenEuros = lindenEuros;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public int getAppId() {
		return appId;
	}

	public void setAppId(int appId) {
		this.appId = appId;
	}

	public int getBetNumber() {
		return betNumber;
	}

	public void setBetNumber(int betNumber) {
		this.betNumber = betNumber;
	}

	public LotteryGame getLotteryGame() {
		return lotteryGame;
	}

	public void setLotteryGame(LotteryGame lotteryGame) {
		this.lotteryGame = lotteryGame;
	}
    
}
